package exam.test2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hzniufanglong
 * Date: 2020-06-20
 * Time: 11:22
 */
public class HotelDatabase {

	private int guestsInARoom;

	private static int totalGuests;

	public String addGuestsToRoom(int room_number, int number_of_guest_to_add) {
		if (guestsInARoom == 0) {
			guestsInARoom = number_of_guest_to_add;
			totalGuests += number_of_guest_to_add;
			return null;
		}
		return "Room is not empty";
	}

	public String removeGuestsFromRoom(int room_number) {
		if (guestsInARoom > 0) {
			totalGuests -= guestsInARoom;
			guestsInARoom = 0;
			return null;
		}
		return "Room is empty";
	}

	public static int getTotal() {
		return totalGuests;
	}
}
